package com.huifaapp.mall.adapter;

import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.huifaapp.mall.fragment.TmallClassifyBaseFragment;

import java.util.List;

/**
 * Created by duanyu on 2017/12/25.
 */

public class JDcomclassifyAdapter extends FragmentPagerAdapter {
    private List<TmallClassifyBaseFragment> tmallClassifyBaseFragments;

    public JDcomclassifyAdapter(FragmentManager fm, List<TmallClassifyBaseFragment> tmallClassifyBaseFragments) {
        super(fm);
        this.tmallClassifyBaseFragments = tmallClassifyBaseFragments;
    }

    @Override
    public TmallClassifyBaseFragment getItem(int position) {
        return tmallClassifyBaseFragments.get(position);
    }

    @Override
    public int getCount() {
        return tmallClassifyBaseFragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return tmallClassifyBaseFragments.get(position).getFragmentTitle();
    }
}
